package cn.tedu.file;

import com.sun.corba.se.spi.resolver.Resolver;

import java.io.File;
import java.io.IOException;
import java.util.Arrays;

/**
 * @author :Colin
 * @version 创建时间: 2021/6/16 20:22
 */
public class TestFileReview {
    public static void main(String[] args) throws IOException {
        File f=new File("D:\\PUNK\\a");
        System.out.println(f.isDirectory());
        System.out.println(f.isFile());
        System.out.println(f.exists());
        File f1=new File("D:\\PUNK\\a\\a.txt");
        System.out.println(f1.length());
        System.out.println(f1.getAbsolutePath());
        System.out.println(f1.getParent());
        System.out.println(f1.getName());
        f=new File("D:\\PUNK\\a\\c.txt");
        System.out.println(f.createNewFile());
        f=new File("D:\\PUNK\\a\\b.txt");
        System.out.println(f.mkdir());
        f=new File("D:\\PUNK\\a\\b");
        System.out.println(f.delete());
        f=new File("D:\\PUNK");

        String[] list = f.list();
        System.out.println(Arrays.toString(list));
        File[] files = f.listFiles();
        System.out.println(Arrays.toString(files));


    }

}
